from django.db import models
from django.core.urlresolvers import reverse

# Create your models here.
class List(models.Model):
	"""docstring for List"""
	def get_absolute_url(self):
		return reverse('view_list', args=[self.id])
# class Item(models.Model):
# 	"""docstring for It"""
# 	text = models.TextField(default="", unique=True)
# 	list = models.ForeignKey(List, default=None)


class Item(models.Model):
	text = models.TextField(default='')
	list = models.ForeignKey(List, default=None)
	class Meta:
		unique_together = ('list', 'text')